﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for Constantes
/// </summary>
public abstract class Constantes
{
    public static String queryBDs =
                        "SELECT " +
                            "D.NAME AS nombreBD " +
                        "FROM " +
                            "SYSDATABASES D";
    public static String queryTablas =
                        "SELECT " +
                            "O.NAME nombreTabla " +
                        "FROM " +
                            "SYSOBJECTS O " +
                        "WHERE " +
                            "XTYPE='U'";

    public static String queryColumnas =
                        "SELECT " +
                            "O.NAME AS nombreTabla, " +
                            "C.NAME AS nombreColumna, " +
                            "T.NAME AS tipoColumna " +
                        "FROM " +
                            "SYSCOLUMNS C, " +
                            "SYSTYPES T, " +
                            "SYSOBJECTS O " +
                        "WHERE " +
                            "C.XTYPE=T.XTYPE AND " +
                            "O.ID=C.ID AND " +
                            "O.XTYPE='U' " +
                        "GROUP BY O.NAME, " +
                            "C.NAME, " +
                            "T.NAME";

    public static String queryProcedimientos =
                        "SELECT " +
                            "O.NAME AS nombreProcedimiento, " +
                            "OBJECT_DEFINITION(O.ID) AS textoProcedimiento " +
                        "FROM " +
                            "SYSOBJECTS O " +
                        "WHERE " +
                            "O.XTYPE='P' AND " +
                            "O.CATEGORY=0 ";
}
